import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/team_logos_entity.dart';

TeamLogosEntity $TeamLogosEntityFromJson(Map<String, dynamic> json) {
  final TeamLogosEntity teamLogosEntity = TeamLogosEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    teamLogosEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    teamLogosEntity.msg = msg;
  }
  final List<TeamLogosData>? data = (json['data'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<TeamLogosData>(e) as TeamLogosData)
      .toList();
  if (data != null) {
    teamLogosEntity.data = data;
  }
  return teamLogosEntity;
}

Map<String, dynamic> $TeamLogosEntityToJson(TeamLogosEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['data'] = entity.data.map((v) => v.toJson()).toList();
  return data;
}

extension TeamLogosEntityExtension on TeamLogosEntity {
  TeamLogosEntity copyWith({
    int? code,
    String? msg,
    List<TeamLogosData>? data,
  }) {
    return TeamLogosEntity()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}

TeamLogosData $TeamLogosDataFromJson(Map<String, dynamic> json) {
  final TeamLogosData teamLogosData = TeamLogosData();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    teamLogosData.id = id;
  }
  final String? logo = jsonConvert.convert<String>(json['logo']);
  if (logo != null) {
    teamLogosData.logo = logo;
  }
  final String? zjLogo = jsonConvert.convert<String>(json['zj_logo']);
  if (zjLogo != null) {
    teamLogosData.zjLogo = zjLogo;
  }
  final String? anotherName = jsonConvert.convert<String>(json['another_name']);
  if (anotherName != null) {
    teamLogosData.anotherName = anotherName;
  }

  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    teamLogosData.type = type;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    teamLogosData.name = name;
  }
  final String? code = jsonConvert.convert<String>(json['code']);
  if (code != null) {
    teamLogosData.code = code;
  }
  return teamLogosData;
}

Map<String, dynamic> $TeamLogosDataToJson(TeamLogosData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['zj_logo'] = entity.zjLogo;
  data['another_name'] = entity.anotherName;
  data['logo'] = entity.logo;
  data['type'] = entity.type;
  data['name'] = entity.name;
  data['code'] = entity.code;

  return data;
}

extension TeamLogosDataExtension on TeamLogosData {
  TeamLogosData copyWith({
    String? id,
    String? logo,
    String? zjLogo,
    String? anotherName,
    String? type,
    String? name,
    String? code,
  }) {
    return TeamLogosData()
      ..id = id ?? this.id
      ..zjLogo = zjLogo ?? this.zjLogo
      ..anotherName = anotherName ?? this.anotherName
      ..logo = logo ?? this.logo
      ..type = type ?? this.type
      ..name = name ?? this.name
      ..code = code ?? this.code;
  }
}